<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" type="text/css" href="/public/static/wx/css/base.css" />
    <link rel="stylesheet" type="text/css" href="/public/static/wx/font/font-awesome-4.7.0/css/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="/public/static/wx/plug-in/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/public/static/wx/css/list-detail.css" />
    <link rel="stylesheet" type="text/css" href="/public/static/wx/css/common.css" />
    <script src="/public/static/wx/js/flex.js" type="text/javascript" charset="utf-8"></script>
    <title>任务信息</title>
    <style type="text/css">
        #layui-layer1{
            overflow: hidden;
        }

        .buttons a{
            width: 100%;
            height: 100%;
            color: #fff;
        }

        .weui_mask_transparent{
            z-index: 2000 !important;
        }
        .c-float-modePop{
            z-index: 5000 !important;
            position: relative !important;
        }
    </style>
</head>

<body>
<div class="index">
    <ul class="list">
        <li class="clearfix">
            <p class="title">标题</p>
            <p class="content">{$info.title}</p>
        </li>
        <li class="clearfix">
            <p class="title">电话</p>
            <p class="content">{$info.tel}</p>
        </li>
        <li class="clearfix">
            <p class="title">联系人</p>
            <p class="content">{$info.name}</p>
        </li>
        <li class="clearfix">
            <p class="title">地址</p>
            <p class="content">{$info.address}</p>
        </li>
        <li class="clearfix area">
            <p class="title">故障类型</p>
            <p class="content">{$info.fault_name}</p>
        </li>
        <li class="clearfix">
            <p class="title">描述</p>
            <p class="content">{$info.desc}</p>
        </li>
        <li class="clearfix">
            <p class="title">附件</p>
            <p class="content">
                {if condition=" !empty($info.attach)"}
                <a href="{$info.attach}" style="color: #009E94;">附件1</a>
                {/if}
                {if condition=" !empty($info.w_attach)"}
                <a href="{$info.w_attach}" style="color: #009E94;">附件2</a>
                {/if}
            </p>
        </li>
        <li class="clearfix">
            <p class="title">创建时间</p>
            <p class="content">{$info.c_time}</p>
        </li>

        <li class="clearfix">
            <p class="title">状态</p>
            <p class="content">{$info.state_name}</p>
        </li>
        <!-- <li class="clearfix">
             <p class="title">拒单原因</p>
             <input type="text" placeholder="请输入拒单原因" />
         </li>-->
    </ul>
    <!-- <ul class="buttons jiedan clearfix">
         <li class="refuse">选择工具</li>
         <li class="apply">工具列表</li>
         <li class="follow">跟踪状态</li>
     </ul>-->
    <ul class="buttons clearfix" style="display: flex;text-align: center;justify-content: center">
        {if condition="$info.state_id==11"}
        <li class="add-follow"><a href="{:url('addDisUI')}?id={$info.id}">创建派单</a></li>
        {/if}
        {if condition="$info.state_id<12"}
        <li class="follow" onclick="clor({$info.id})">关闭</li>
        {/if}
        {if condition="$info.state_id==12 || $info.state_id==13"}
        <li class="add-follow"><a href="{:url('getDisUI')}?wid={$info.id}">查看派单</a></li>
        {/if}

    </ul>
</div>

<script src="/public/static/wx/js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/public/static/wx/plug-in/layui/layui.all.js" type="text/javascript" charset="utf-8"></script>
<script src="/public/static/wx/js/alertPopShow.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
    var layer = layui.layer;
    $('.apply').on('click',function(){
        layer.open({
            type: 2,
            area: ['70%', '60%'],
            title: '可选工程师',
            content: 'choose-engineer.html',
            scrollbar:false,
            success: function(layero, index) {

            },
        });
    })


    function clor(id) {
        popTipShow.confirm('关闭工单','您确认要关闭工单吗？',['确 定','取 消'],
            function(e){
                //callback 处理按钮事件
                var button = $(e.target).attr('class');
                if(button == 'ok'){
                    this.hide();
                    $.post('{:url("closeWork")}',{id:id},function (res) {
                        if(res.code == 1){
                            layer.msg('关闭工单成功',{icon:6},function () {
                                location.href = location.href+"&t";
                            });
                        }
                    });
                }

                if(button == 'cancel') {

                    this.hide();

                }
            }
        );
    }
</script>
</body>

</html>